package com.woniu.cq.medical.dao;

import com.woniu.cq.medical.entity.Patient;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Lucas
 * @since 2020-09-05
 */
public interface PatientMapper extends BaseMapper<Patient> {

    @Select("SELECT p.patient_id,p.patient_name,p.patient_id_card,p.patient_phone_number," +
            "p.patient_address,p.patient_sex,p.patient_age,p.patient_password,p.medical_card_id," +
            "p.patient_birthday,p.patient_occupation,p.`patient_native place`," +
            "p.patient_into_time,p.patient_last_modification_time from lonbon_patient p " +
            "where p.patient_id_card = #{idCard}")
    Patient selectPatientByIdCard(String idCard);

    @Select("SELECT * FROM lonbon_patient where patient_id_card=#{patientIdCard}")
    Patient queryCardIdRepetition(String patientIdCard);
}
